article data-cable-post-id=post.id
  header
    .float-right
      .btn-group
        = link_to edit_post_path(post), class: 'btn btn-outline-dark', data: { toggle: 'tooltip', placement: 'bottom' }, title: 'Edit Post' do
          i.fas.fa-edit.fa-lg

        = link_to post, method: :delete, class: 'btn btn-outline-dark', data: { toggle: 'tooltip', placement: 'bottom', confirm: 'Are you sure?' }, role: 'button', title: 'Delete Post' do
          i.fas.fa-trash-alt.fa-lg

    h1.display-4
      = post.title

    time.badge.badge-secondary datetime=post.updated_at.iso8601
      => distance_of_time_in_words_to_now post.updated_at
      | ago

  - if post.clips.present?
    ruby:
      images = post.clips.map do |clip|
        { src:             clip.image_url(:large, expires_in: 1.day.to_i),
          thumbnail:       clip.image_url(:thumbnail, expires_in: 1.day.to_i),
          thumbnailWidth:  400,
          thumbnailHeight: 400
        }
      end

    - images.each_with_index do |image, index|
      .cssbox style="margin: 20px 0"
        = content_tag :a, id: "image#{index+1}", href: "#image#{index+1}" do
          img.cssbox_thumb src= image[:thumbnail] style="width:200px; height: 200px" alt=""
          span.cssbox_full
            img src= image[:src] alt=""
        a.cssbox_close href="#void"
        a.cssbox_prev href="#image1" &lt;
        a.cssbox_next href="#image3" &gt;

    hr

  == post.content

  - if post.copyright.present?
    hr
    .small.text-muted
      == post.copyright
